package com.song.mapper;

import com.song.domain.Order;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderMapper {
    Order selectById(@Param("id") Long id);
    List<Order> list(@Param("offset") int offset, @Param("limit") int limit,
                     @Param("status") String status,
                     @Param("startDate") java.util.Date startDate,
                     @Param("endDate") java.util.Date endDate,
                     @Param("customerName") String customerName);
    int count(@Param("status") String status,
              @Param("startDate") java.util.Date startDate,
              @Param("endDate") java.util.Date endDate,
              @Param("customerName") String customerName);
    List<Order> listAll(@Param("status") String status,
                        @Param("startDate") java.util.Date startDate,
                        @Param("endDate") java.util.Date endDate,
                        @Param("customerName") String customerName);

    java.math.BigDecimal sumTotal();
    int countByCustomerId(@Param("customerId") Long customerId);
    int insert(Order order);
    int update(Order order);
    int delete(@Param("id") Long id);
}